home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_ctladder.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  163 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHS_ctladder.cog      Make the roof ladder of the clock tower move.  
  4. #
  5. # [JWC, RKD]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message     entered
  14.  
  15. keyframe    in_falling=in_jump_fall.key            local //159x
  16. keyframe    in_landhard=in_jump_land_hard.key    local //57x
  17.  
  18. sound        laddermove=shs_ladder_creak_c.wav        local
  19. sound        ladderstop=shs_ladderroll_stop.wav        local
  20. sound        ladderfall=shs_ladder_moving.wav        local
  21. sound         music=mus_gen_magic2.wav                local
  22. sound       in_whoa=inxj007.wav                       local
  23. sound        inOof=inxj016a.wav                      local   # ooof...
  24.  
  25.  
  26. surface        climable
  27. surface        land            mask=0x004
  28.  
  29. thing       ladder1                     # roof ladder
  30.                             
  31. thing        indy
  32. thing        cam1
  33. thing        c1_t1
  34. thing        c1_t2
  35. thing        player                local
  36. thing        posGhost
  37. thing        dummycam  
  38. thing         in_mk0
  39.  
  40. int          locked=0             local
  41. int            doorpos=0            local    # position of roof ladder 0=closed, 1=open
  42. int            curCam                local
  43. int            in_track0            local
  44.  
  45. int            pl_colltype            local
  46.  
  47. cog            NoWorkTalkcog
  48.  
  49. end
  50.  
  51. # ========================================================================================
  52.  
  53. code
  54.  
  55. entered:
  56.     
  57.     # open roof ladder when Indy steps on it, like a trap
  58.     
  59.     if (GetSenderRef()==ladder1)
  60.     {
  61.         if (doorpos==1) return;
  62.         
  63.         # make this fast and jerky
  64.         doorpos=1;
  65.         player = GetLocalPlayerThing();
  66.         curCam = GetCurrentCamera(); 
  67.         sleep(.1);         # to allow indy to be on the ladder
  68.         AISetCutsceneMode(indy);
  69.         MakeMeStop();
  70.         StartCutscene(0);
  71.         CopyPlayerHolsters(player, indy); # make sure our actor has matching props
  72.         
  73.         # cut to inside clock tower
  74.         
  75.         # Prep camera & cut...
  76.         SetCameraLookInterp(2, 0); # no pan & tilt
  77.         SetCameraPosInterp(2, 0); # no dolly
  78.         SetCameraFocus(2, cam1);
  79.         SetCameraSecondaryFocus(2, c1_t1);
  80.         Sleep(0.01);
  81.         SetCurrentCamera(2);
  82.         SetCameraFOV(70, 0, 0.0);
  83.         
  84.         DetachThing(player);
  85.         TeleportThing(player, posGhost); # put player in safe spot
  86.         pl_colltype = GetCollideType(player);
  87.         SetCollideType(player, 0);
  88.         SetThingFlags(player, 0x10); # hide player
  89.                       
  90.         sleep(.01);
  91.         
  92.         Setcollidetype(ladder1, 0);
  93.         Rotate(ladder1, 90, 0, .5);    # opens roof ladder
  94.         PlaySoundLocal(ladderfall, 1.0, 0, 0x0000, 0);
  95.         PlayVoice(indy, in_whoa, 1.0, 0);
  96.         WaitForStop(ladder1);
  97.         SetCollideType(ladder1, 3);                    # give ladder collision
  98.         
  99.         ClearThingFlags(indy, 0x80000); # actor visible
  100.  
  101.         CopyOrientAndPos(in_mk0, indy); #  orient actor
  102.  
  103.         //Indy drops down
  104.         ClearThingFlags(indy, 0x4000); //shadow off
  105.         in_track0 = PlayKey(indy, in_falling, 6, 0x10, 0);
  106.         #Print("Falling!");
  107.         PrintInt(in_track0);
  108.         ClearThingFlags(indy, 0x4000); //shadow off
  109.         #return;
  110.     }
  111.  
  112.     if (GetSenderRef() == land)
  113.     {
  114.         #Print("the beagle has landed");
  115.         SetThingFlags(indy, 0x4000); //shadow on
  116.         StopKey(indy, in_track0, 0);
  117.         # oof!
  118.         PlayVoice(indy, inOof, 1.0, 0);
  119.         PlayKey(indy, in_landhard, 4, 0x12, 1); //ouch
  120.  
  121.         TeleportThing(player, indy);
  122.         
  123.         # make adjoin climable
  124.         ClearAdjoinFlags(climable, 0x2);     # make adjoin no move
  125.         
  126.         # pan to bellringer
  127.         SetCameraLookInterp(2, 1);             # pan & tilt
  128.         SetCameraInterpSpeed(2, 3.0);
  129.         Sleep(0.01);                   
  130.         SetCameraSecondaryFocus(2, c1_t2);
  131.     
  132.         # play music
  133.         PlaySoundLocal(music, 1.0, 0, 0x0000, 0);
  134.         
  135.            
  136.         # close in
  137.         SetCameraFOV(55, 1, 3.0);
  138.                 
  139.         sleep(4.0);
  140.  
  141.         # cleanup
  142.        
  143.         SetThingFlags(indy, 0x80000);                     # hide actor    
  144.         ClearThingFlags(player, 0x10);
  145.         SetCollideType(player, pl_colltype);
  146.  
  147.         # prep for camera to swing back
  148.         SetCameraPosition(1, VectorAdd(VectorTransformToOrient(player, '-0.25 -0.1 0.0'), GetThingPos(player)));     # from the left side of indy
  149.         SetCurrentCamera(curCam);
  150.         ResetCameraFOV(0, 0.0);
  151.         
  152.         ClearActorFlags(player, 0x200000);                 # player in control
  153.         EndCutscene();
  154.           
  155.     }
  156.  
  157.    
  158.        
  159.     return;
  160.     
  161.  
  162. end
  163.